<?php defined('_MARKDOWN_EDITOR') or die('Access Deny!');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta charset="utf-8">
    <title>Cmd - 在线 MarkDown 编辑阅读器</title>

    <!-- Bootstrap -->
    <link href="static/css/bootstrap.css" rel="stylesheet" media="screen">

    <!-- jQuery UI -->
    <link href="static/css/smoothness/jquery-ui-1.10.2.custom.min.css" rel="stylesheet" media="screen">

    <!-- awesome font -->
    <link href="static/font-awesome/css/font-awesome.css" rel="stylesheet">

    <link href="static/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
    <link href="static/editor/editor.css" rel="stylesheet">

    <!-- Bootstrap Responsive -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="static/css/bootstrap-responsive.css" rel="stylesheet">
</head>
<body class="theme">
    <div id="container">
        <div id="editor-nav-bar">
            <div id="wmd-button-bar" class="pull-left"></div>
            <div id="preview-button-bar" class="pull-right">
                <ul id="preview-button-row" class="preview-button-row">
                    <!-- <li class="preview-button" id="preview-new-button" title="新建文件 Ctrl+Alt+N">
                        <span class="icon-file muted"></span>
                    </li> -->
                    <li class="preview-button" id="preview-theme-button" title="主题切换 Ctrl+Alt+J">
                        <span class="icon-shield muted"></span>
                    </li>
                    <li class="preview-button" id="preview-reader-full-button" title="阅读模式 Ctrl+Alt+M">
                        <span class="icon-desktop muted"></span>
                    </li>
                    <li class="preview-button" id="preview-reader-small-button" title="预览模式 Ctrl+Alt+M">
                        <span class="icon-columns muted"></span>
                    </li>
                    <li class="preview-button" id="preview-fullscreen-button" title="全屏模式 F11">
                        <span class="icon-fullscreen muted"></span>
                    </li>
                    <!-- There is at least one item of 'wmd-spacer' must be in the ul list, otherwise, the hover on the button leads to page issue. -->
                    <li class="wmd-spacer"></li>
                </ul>
            </div>
            <div id="article-title-bar" class="pull-right">
                <span class="markdown-desc"><?php echo JText::_('PLG_EDITORS_XTD_MARKDOWN_DESC'); ?></span>
                <a href="javascript:;" id="insertMarkdownBtn" class="btn"><?php echo JText::_('PLG_EDITORS_XTD_MARKDOWN_SAVE'); ?></a>
            </div>
            <div class="clearfix"></div>
        </div>

        <div id="left-column" class="pull-left">
            <div id="wmd-panel-editor" class="wmd-panel-editor">
                <textarea class="wmd-input theme" id="wmd-input" spellcheck="false"></textarea>
            </div>
        </div>
        <div id="right-column" class="pull-right">
            <div id="wmd-panel-preview" class="wmd-panel-preview preview-container">
                <div id="wmd-preview" class="wmd-preview"></div>
            </div>
        </div>

        <div class="clearfix"></div>
    </div>

    <!-- Hidden md-section-helper is used to calculate the height of md sections. -->
    <textarea id="md-section-helper"></textarea>

    <!-- Hidden Popup Modal -->
    <div id="editorDialog" class="modal hide fade theme" tabindex="-1" role="dialog" aria-labelledby="notification-title" aria-hidden="true">
        <div class="modal-header theme">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="editorDialog-title"></h3>
        </div>
        <div class="modal-body theme">
            <p></p> <i class="icon-2x"></i>
            <input class="span5" type="text" placeholder=''></div>
        <div class="modal-footer theme">
            <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
            <button id="editorDialog-confirm" class="btn btn-primary">确认</button>
        </div>
    </div>

    <!-- full editor reader, hidden when loading. -->
    <div id="editor-reader-full" class="editor-reader-full-hidden"></div>

    <!-- jquery & Bootstrap -->
    <script src="static/js/jquery-1.8.3.min.js"></script>
    <script src="static/js/jquery-ui-1.10.2.custom.min.js"></script>
    <script src="static/js/jquery.ui.datepicker-zh-CN.js"></script>
    <script src="static/js/bootstrap.js"></script>

    <script src="static/js/jquery.storage.js"></script>
    <script src="static/editor/google-code-prettify/prettify.js"></script>
    <script src="static/editor/pagedown/Markdown.Converter.js"></script>
    <script src="static/editor/pagedown/Markdown.Sanitizer.js"></script>
    <script src="static/editor/pagedown/Markdown.Editor.js"></script>
    <script src="static/editor/pagedown/local/Markdown.local.zh.js"></script>
    <script src="static/editor/Markdown.Extra.js"></script>
    <script src="static/editor/underscore.js"></script>
    <script src="static/editor/css_browser_selector.js"></script>
    <script src="static/editor/scrollLink.js"></script>
    <!--mathjax-->
    <script type="text/x-mathjax-config">
          MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true },  messageStyle: "none"});
    </script>
    <!--mathjax source code is here: https://github.com/mathjax/MathJax, you could host it on your own server one day.-->
    <script src="static/editor/mathJax.js"></script>
    <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script src="static/editor/jquery.waitforimages.js"></script>
    <script src="static/editor/jquery.autosize-min.js"></script>
    <script type="text/javascript">
        (function($){
            $(document).ready(function($) {
                $("#insertMarkdownBtn").click(function(){
                    var content = $("#wmd-input").val();
                    content = content.replace(/<\?/g, '&lt;?');
                    content = content.replace(/<br\s*\/?>/g, "\n");
                    content = [['<pre class="markdown-doc">'].join(''), content, '</pre>'].join('');
                    window.parent.setMarkdownContent(content);
                    window.parent.SqueezeBox.close();
                });
            });
        })(jQuery);
    </script>
    <script src="static/editor/editor.js"></script>
</body>
</html>